﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserList.aspx.cs" Inherits="School.SystemManage.UserManage.UserList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <link href="../../css/right.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function CheckAll(checkBoxAll,isInTable) {
            var dataTable = document.getElementById("DataList");
            var checkBoxes = dataTable.getElementsByTagName("INPUT");
            var startIndex = 0;
            if (isInTable) {
                startIndex = 1;
            }
            for (var i = startIndex; i < checkBoxes.length; i++) {
                checkBoxes[i].checked = checkBoxAll.checked;
            }
        }

        function HasCheckedRow() {
            var dataTable = document.getElementById("DataList");
            var checkBoxes = dataTable.getElementsByTagName("INPUT");
            for (var i = 1; i < checkBoxes.length; i++) {
                if (checkBoxes[i].checked)
                    return confirm("确定要删除吗？");
            }
            alert("选择要删除的项");
            return false;
        }
        
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="container">
        <div class="title_bg">
            <div class="floatLeft title_text_div">用户管理 > 人员基本信息列表</div> 
            <ul class="floatRight">
                <li><input id="chk_Total" type="checkbox" class="floatLeft" onclick="CheckAll(this,false);" /><span class="checkAll floatLeft">全选</span><div class="clear"></div></li>
                <li class="add"><a href="../../WebPages/UserManage/UserEdit.aspx?action=add">添加</a></li>
                <li class="delete"><asp:LinkButton ID="lbtnDelete" runat="server" 
                        OnClientClick="return HasCheckedRow();" onclick="lbtnDelete_Click">删除</asp:LinkButton></li>
            </ul>
            <div class="clear"></div>
        </div>
        <div >
            <asp:Repeater ID="rep_Users" runat="server">
                <HeaderTemplate>
                    <table cellspacing="0" id="DataList" class="dataTable">
                        <tr>
                            <th style=" width:10%"><input id="chk_All" type="checkbox" onclick="CheckAll(this,true);" /></th>
                            <th style=" width:10%">用户名</th>
                            <th style=" width:20%">用户密码</th>
                            <th style=" width:10%">真实姓名</th>
                            <th style=" width:20%">最后登录时间</th>
                            <th style=" width:10%">是否可用</th>
                            <th style=" width:10%">角色</th>
                            <th style=" width:10%">基本操作</th>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td><asp:CheckBox ID="cbChecked" runat="server"/></td>
                        <td><asp:HiddenField ID="hfUid" runat="server" Value='<%#Eval("UserID") %>' /> <%#Eval("UserName") %></td>
                        <td><%#Eval("UserPwd") %></td>
                        <td><%#Eval("RealName") %></td>
                        <td><%#Eval("LoginTime") %></td>
                        <td><%#(bool)Eval("Enabled") == true ? "是" : "否"%></td>
                        <td><%#Eval("RoleName") %></td>
                        <td><a href='../../WebPages/UserManage/UserEdit.aspx?action=edit&uid=<%#Eval("UserID") %>'>编辑</a></td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
        </div>
        <div class="red">
            <asp:Label ID="msg" runat="server" Text=""></asp:Label></div>
    </div>
    </form>
</body>
</html>
